//
//  AutohViewController.swift
//  WBSwift
//
//  Created by 钱学明 on 2017/3/12.
//  Copyright © 2017年 STT. All rights reserved.
//

import UIKit

class AutohViewController: UIViewController {
    
    // webview
    @IBOutlet weak var comtomWebview: UIWebView!
    override func viewDidLoad() {
        super.viewDidLoad()
        let urlString  = "https://api.weibo.com/oauth2/authorize?client_id=1037129243&redirect_uri=http://www.baidu.com"
        guard let ul = NSURL(string:urlString) else {
            return
        }
        let request = URLRequest.init(url: ul as URL)
        comtomWebview.loadRequest(request)
    }
}


extension AutohViewController:UIWebViewDelegate{
    
    func webViewDidStartLoad(_ webView: UIWebView) {
    
        
        
    }
    
    // 该方法每次访问页面都会调用
    func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
        
        ALog(messge: request)
        
        return true
    }
}

